//
//  SampleListActivity.swift
//  ios_guard
//
//  Created by linus on 2021/11/19.
//

import UIKit

class SampleListActivity: UITableViewController {
    let from = ["Authing 标准登录", "iOS 默认风格登录", "手机号一键登录", "微信", "Theragun", "阿宝说", "Nissan Virtual Key", "AppAuth", "Authing WebView"]
    let reuseIdentifier = "cell"
    
    override func viewDidLoad() {
        super.viewDidLoad()
        tableView.register(UITableViewCell.self, forCellReuseIdentifier: reuseIdentifier)
    }
    
    override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return from.count
    }
    
    override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: reuseIdentifier)!
        cell.textLabel?.text = from[indexPath.row]
        return cell
    }
    
    override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        if indexPath.row == 0 {
            let vc = AuthingDemoLoginActivity(nibName: nil, bundle: nil)
            vc.modalPresentationStyle = .fullScreen
            present(vc, animated: true, completion: nil)
            return;
        }
    }
}

